home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / comm / term / term_source.lha / Extras / Source / gtlayout-source.lha / LTP_DrawPrevNext.c < prev    next >
C/C++ Source or Header  |  1996-03-18  |  977b  |  53 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #ifdef DO_TAPEDECK_KIND
  15. VOID
  16. LTP_DrawPrevNext(struct RastPort *RPort,BOOL Prev,LONG Left,LONG Top,LONG Width,LONG Height)
  17. {
  18.     LONG i,Len,Start,ArrowWidth,ArrowHeight,LineWidth,Pos;
  19.  
  20.     LineWidth    = (Width + 15) / 16;
  21.     ArrowWidth    = Width;
  22.     ArrowHeight    = Height;
  23.     Left        = Left - (LineWidth / 2);
  24.  
  25.     for(i = 0 ; i < ArrowWidth ; i++)
  26.     {
  27.         Len = ((ArrowHeight * (i + 1)) / ArrowWidth) & ~1;
  28.  
  29.         if(Len < ArrowHeight)
  30.             Len++;
  31.  
  32.         Start = Top + (ArrowHeight - Len) / 2;
  33.  
  34.         if(Prev)
  35.             Pos = Left + i;
  36.         else
  37.             Pos = Left + ArrowWidth - 1 - i;
  38.  
  39.         LTP_DrawLine(RPort,Pos,Start,Pos,Start + Len - 1);
  40.     }
  41.  
  42.     for(i = 0 ; i < LineWidth ; i++)
  43.     {
  44.         if(Prev)
  45.             Pos = Left + i;
  46.         else
  47.             Pos = Left + ArrowWidth - 1 - i;
  48.  
  49.         LTP_DrawLine(RPort,Pos,Top,Pos,Top + Height - 1);
  50.     }
  51. }
  52. #endif    /* DO_TAPEDECK_KIND */
  53.